package itheima.com.MapTest;

import java.util.TreeMap;

public class MyTreeMapDemo01 {
    public static void main(String[] args) {
        TreeMap<Student,String> tm = new TreeMap<>();

        Student s1 = new Student("尤里",22);
        Student s2 = new Student("莎琳",24);
        Student s3 = new Student("库緈",23);

        tm.put(s1,"德国");
        tm.put(s2,"法国");
        tm.put(s3,"美国");

        tm.forEach(
                (Student key,String value)->{
                    System.out.println(key+value);
                }
        );
    }
}
